package com.hengli.mapper;

import com.hengli.entity.WinepackageWine;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ljx
 * @date 2024/3/24 17:15
 */
@Mapper
public interface WinepackageWineMapper {
    /**
     * 根据酒品id查询对应的套餐id
     *
     * @param wineIds
     * @return
     */
    List<Long> getWinepackageIdsByWineIds(List<Long> wineIds);

    /**
     * 批量插入套餐菜品数据
     * @param winepackageWineList
     */
    void insertBatch(List<WinepackageWine> winepackageWineList);

    /**
     * 根据套餐id删除套餐和酒品的关联关系
     * @param winepackageId
     */
    @Delete("Delete from winepackage_wine where winepackage_id = #{winepackageId}")
    void deleteByWinepackageId(Long winepackageId);

    /**
     * 根据套餐id查询套餐和酒品的关联关系
     * @param id
     * @return
     */
    @Select("Select * from winepackage_wine where winepackage_id = #{winepackageId}")
    List<WinepackageWine> getDishByWinepackageId(Long id);
}
